from rest_framework import serializers
from . import models


class BannerModelSerializer(serializers.ModelSerializer):
    """
    轮播图的序列化器
    """

    class Meta:
        model = models.Banner
        fields = ['id', 'link', 'image_url']


class NavModelSerializer(serializers.ModelSerializer):
    """
    顶部导航栏的序列化器
    """

    class Meta:
        model = models.Nav
        fields= ['id','title','link','is_site']